import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class FlowPanel extends JPanel{
    protected JButton btnConfirm = new JButton("确定");
    protected JButton btnReturn = new JButton("返回");

    {
        int width = 190;
        int height = 60;
        Dimension btnSize = new Dimension(width,height);
        Font btnFont = new Font("Monospaced", Font.PLAIN, 24);

        btnConfirm.setPreferredSize(btnSize);
        btnConfirm.setFont(btnFont);

        btnReturn.setPreferredSize(btnSize);
        btnReturn.setFont(btnFont);
    }

    public FlowPanel(FlowLayout flowLayout){
        super(flowLayout);
        setBounds(40, 40, 420, 320);
    }

    public void setBtnConfirmListener(ActionListener actionListener) {
        this.btnConfirm.addActionListener(actionListener);
    }

    public void setBtnReturnListener(ActionListener actionListener){
        this.btnReturn.addActionListener(actionListener);
    }

    public void addButton(){
        add(btnConfirm);
        add(btnReturn);
    }
}
